import { createRouter, createWebHistory } from 'vue-router'
import type { RouteRecordRaw } from 'vue-router'

const routes: RouteRecordRaw[] = [
  {
    path: '/index',
    name: 'Index',
    component: () => import('~/views/index/index.vue')
  },
  {
    path: '/home',
    name: 'Home',
    component: () => import('~/views/tabbar/index.vue'),
    redirect: '/home/home',
    children: [
      {
        path: '/home/home',
        name: 'Home',
        component: () => import('~/views/home/Home.vue')
      },
      {
        path: '/home/drink',
        name: 'Drink',
        component: () => import('~/views/order/Drink.vue')
      },
      {
        path: '/home/my',
        name: 'My',
        component: () => import('~/views/my/My.vue')
      },
      {
        path: '/home/product',
        name: 'Product',
        component: () => import('~/views/order/Product.vue')
      },
      {
        path: '/home/tea',
        name: 'Tea',
        component: () => import('~/views/take/index.vue')
      }
    ]
  },
  {
    path: '/scan',
    name: 'Scan',
    component: () => import('~/views/scan/index.vue')
  },
  {
    path: '/invite',
    name: 'Invite',
    component: () => import('~/views/invite/Invite.vue')
  },
  {
    path: '/redbag',
    name: 'Redbag',
    component: () => import('~/views/invite/Redbag.vue')
  },
  {
    path: '/redbagview',
    name: 'RedbagView',
    component: () => import('~/views/invite/RedbagView.vue')
  },
  {
    path: '/given',
    name: 'Given',
    component: () => import('~/views/invite/Given.vue')
  },
  {
    path: '/promotion',
    name: 'Promotion',
    component: () => import('~/views/invite/Promotion.vue')
  },
  {
    path: '/inviteRecords',
    name: 'InviteRecords',
    component: () => import('~/views/invite/Records.vue')
  },
  {
    path: '/shop',
    name: 'Shop',
    component: () => import('~/views/order/Shop.vue')
  },
  {
    path: '/drinkDetail',
    name: 'DrinkDetail',
    component: () => import('~/views/order/DrinkDetail.vue')
  },
  {
    path: '/productDetail',
    name: 'ProductDetail',
    component: () => import('~/views/order/ProductDetail.vue')
  },
  {
    path: '/share',
    name: 'Share',
    component: () => import('~/views/share/index.vue')
  },
  {
    path: '/assets',
    name: 'Assets',
    component: () => import('~/views/my/Assets.vue')
  },
  {
    path: '/msgs',
    name: 'Msgs',
    component: () => import('~/views/my/Msgs.vue')
  },
  {
    path: '/coupons',
    name: 'Coupons',
    component: () => import('~/views/my/Coupons.vue')
  },
  {
    path: '/submit',
    name: 'Submit',
    component: () => import('~/views/order/Submit.vue')
  },
  {
    path: '/take',
    name: 'Take',
    component: () => import('~/views/order/Take.vue')
  },
  {
    path: '/clockIn',
    name: 'ClockIn',
    component: () => import('~/views/employee/ClockIn.vue')
  },
  {
    path: '/agentInfo',
    name: 'AgentInfo',
    component: () => import('~/views/agent/Info.vue')
  },
  {
    path: '/agentSelf',
    name: 'AgentSelf',
    component: () => import('~/views/agent/Self.vue')
  },
  {
    path: '/agentOrders',
    name: 'AgentOrders',
    component: () => import('~/views/agent/Orders.vue')
  },
  {
    path: '/agentProducts',
    name: 'AgentProducts',
    component: () => import('~/views/agent/Products.vue')
  },
  {
    path: '/agentProduct',
    name: 'AgentProduct',
    component: () => import('~/views/agent/Product.vue')
  },
  {
    path: '/agentPickUps',
    name: 'AgentPickUps',
    component: () => import('~/views/agent/PickUps.vue')
  },
  {
    path: '/prize',
    name: 'Prize',
    component: () => import('~/views/prize/Prize.vue')
  },
  {
    path: '/prizes',
    name: 'Prizes',
    component: () => import('~/views/prize/Prizes.vue')
  },
  {
    path: '/error',
    name: 'Error',
    component: () => import('~/views/error/index.vue')
  },
  {
    path: '/',
    redirect: '/index'
  }
]

export default createRouter({
  history: createWebHistory('/tea/'),
  routes
})
